﻿@{
    Layout = null;
}
<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="users/role" method="post">
        <div class="bjui-searchBar">
            <label>关键字：</label><input type="text" id="SearchKeyWords" value="@ViewBag.SearchKeyWords" name="SearchKeyWords" class="form-control" size="15" placeholder="">&nbsp;
            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
            <a class="btn btn-orange" href="javascript:;" data-toggle="reloadsearch" data-clear-query="true" data-icon="undo">清空查询</a>
            <a class="btn btn-green" href="Users/RoleEdit" data-toggle="dialog" data-width="500" data-height="150" data-id="UsersEdit" data-icon="plus">添加角色</a>
        </div>
    </form>
</div>
<div class="bjui-pageContent tableContent">
    <table class="table table-bordered table-hover table-striped table-top" data-selected-multi="true">
        <thead>
            <tr>
                <th align="center"></th>
                <th align="center">角色</th>
                <th width="300" align="center">操作</th>
            </tr>
        </thead>
        <tbody>
            @if (ViewBag.Userslist != null)
            {
                int i = Int32.Parse(ViewBag.PageSize) * (Int32.Parse(ViewBag.PageCurrent) - 1) + 1;
                foreach (var item in ViewBag.Userslist)
                {
                    <tr data-id="@i">
                        <td align="center">@i</td>
                        <td align="center">@item.Role_name</td>

                        <td align="left">
                            @if (item.Id != 1)
                            {
                                <a href = "Users/RoleEdit/@item.Id" class="btn btn-green" data-toggle="dialog" data-width="500" data-height="150" data-id="UsersEdit" data-title="编辑 【@item.Role_name】">编辑</a>
                                <a href = "Users/RoleMenu/@item.Id" class="btn btn-green" data-toggle="dialog" data-max="true" data-id="UsersRoleMenu" data-title="编辑 【@item.Role_name】 菜单权限">菜单权限</a>
                                @*<a href="Users/RoleMenu/@item.Id" class="btn btn-green" data-toggle="dialog" data-max="true" data-id="UsersRoleMenu" data-title="编辑 【@item.Role_name】 操作权限">操作权限</a>*@
                                <a href="Users/UpdateRolemenu/@item.Id" class="btn btn-red" data-toggle="doajax" data-confirm-msg="确定要重置【@item.Role_name】的权限吗？">重置权限</a>
                                <a href="Users/RoleDelete/@item.Id" class="btn btn-red" data-toggle="doajax" data-confirm-msg="确定要删除该角色吗？">删</a>
                            }
                            else
                            {
                                <a href="Users/UpdateAdminmenu" class="btn btn-red" data-toggle="doajax" data-confirm-msg="确定要重置管理员的权限吗？">重置权限</a>
                            }
                        </td>
                    </tr>
                    i++;
                }
            }

        </tbody>
    </table>
</div>
<div class="bjui-pageFooter">
    <div class="pages">
        <span>每页&nbsp;</span>
        <div class="selectPagesize">
            <select data-toggle="selectpicker" data-toggle-change="changepagesize">
                <option value="30">30</option>
                <option value="60">60</option>
                <option value="120">120</option>
                <option value="150">150</option>
            </select>
        </div>
        <span>&nbsp;条，共 @ViewBag.AllRecords 条</span>
    </div>
    <div class="pagination-box" data-toggle="pagination" data-total="@ViewBag.AllRecords" data-page-size="30" data-page-current="1">
    </div>
</div>
